<?php

defined('PHPFOX') or exit('NO DICE!');

class Survey_Component_Ajax_Ajax extends Phpfox_Ajax
{
	public function joinCategory(){
            $iId = $this->get("id");            
            Phpfox::getService("survey.process")->joinCategory($iId,Phpfox::getUserId());
        }
        public function follow(){
            $iId = $this->get("id");            
            Phpfox::getService("survey.process")->follow($iId,Phpfox::getUserId());
        }
        
        public function appendSurvey(){
            $iId = $this->get('id');
            Phpfox::getBlock('survey.entry',array('iSurveyId' => $iId));
            
            $this->call("$('.js_survey_contents').prepend('".$this->getContent()."').highlightFade();\$Core.loadInit();");
        }
        
        public function viewMore(){
            Phpfox::getBlock("survey.display");
            $this->call("$('#view_more_holder').remove();$('.js_survey_contents').append('".$this->getContent()."');\$Core.loadInit();");
        }
        
        public function yourTopic(){
            Phpfox::getBlock("survey.your-topic");
        }
        public function viewMoreYourTopic(){
            Phpfox::getBlock("survey.your-topic");
            $this->call("$('#js_survey_contents .view_more').remove();$('#js_survey_contents .content').append('".$this->getContent()."');");
        }
        public function yourFollowing(){
            Phpfox::getBlock("survey.your-following");
        }
        public function viewMoreYourFollowing(){
            Phpfox::getBlock("survey.your-following");
            $this->call("$('#js_survey_contents .view_more').remove();$('#js_survey_contents .content').append('".$this->getContent()."');");
        }
        public function yourInterest(){
            Phpfox::getBlock("survey.your-interest");
        }
        public function viewMoreYourInterest(){
            Phpfox::getBlock("survey.your-interest");
            $this->call("$('#js_survey_contents .view_more').remove();$('#js_survey_contents .content').append('".$this->getContent()."');");
        }
}

?>